package com.molyfun.parents.im;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.hyphenate.chat.EMMessage;
import com.hyphenate.easeui.EaseConstant;
import com.molyfun.parents.im.model.ChatMessageEntity;
import com.molyfun.parents.rest.bean.CustomPlanlistResponse;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:09/10/2017.
 * 咨询界面
 */

public class ConsultActivity extends BaseChatActivity implements BaseChatActivity.EaseChatFragmentHelper {

    public static final String FLAG_PLAN_LIST_BEAN = "plan_list_bean";

    public static final String GROUP_ID = "group_id";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        mPlanListBean = getIntent().getParcelableExtra(FLAG_PLAN_LIST_BEAN);
        mGroupId = getIntent().getStringExtra(GROUP_ID);
        chatType = EaseConstant.CHATTYPE_GROUP;
        super.onCreate(savedInstanceState);
    }

    public static void startActivity(Context context, CustomPlanlistResponse.PlanListBean planListBean, String groupId){
        Intent intent = new Intent(context, ConsultActivity.class);
        intent.putExtra(FLAG_PLAN_LIST_BEAN, planListBean);
        intent.putExtra(GROUP_ID, groupId);
        context.startActivity(intent);
    }

    @Override
    protected void setUpView() {
        setChatFragmentHelper(this);
        super.setUpView();
    }

    @Override
    public void onSetMessageAttributes(EMMessage message) {
    }

    @Override
    public void onEnterToChatDetails() {

    }

    @Override
    public void onAvatarClick(String username) {
        //handling when user click avatar
        /*Intent intent = new Intent(this, UserProfileActivity.class);
        intent.putExtra("username", username);
        startActivity(intent);*/
    }

    @Override
    public void onAvatarLongClick(String username) {
        inputAtUsername(username);
    }


    @Override
    public boolean onMessageBubbleClick(ChatMessageEntity message) {
        //消息框点击事件，demo这里不做覆盖，如需覆盖，return true
        //red packet code : 拆红包页面
        return false;
    }

//    @Override
//    public void onCmdMessageReceived(List<EMMessage> messages) {
//        super.onCmdMessageReceived(messages);
//    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

}
